<?php if(!defined('IN_FANWE')) exit('Access Denied'); ?>
<div class="piece1_bd">
<div class="fl" style="width:340px;margin:0 10px;height:280px;position: relative;">
<div class="piece_title" style="margin-left:0"></div>
<div id="pic_tpk" class="pic_t_tj">
<ul><?php if(is_array($flash_list)) { foreach($flash_list as $topic) { ?><li class="pic_t_tj_f">
<a target="_blank" href="<?php echo $topic['url'];?>" class="pic_t_tj_f_box"><img scaleSrc="<?php echo getImgName($topic['imgs'][0]['img'],468,468,0); ?>" src="./tpl/images/lazyload.gif" class="LOAD_SCALE_IMG" scaleType="3" scaleWidth="340" scaleHeight="185" /></a><?php echo setTplUserFormat($topic['uid'],4,0,'',0,'pic_author','',''); ?><div class="title ofh">
<a class="topic_title tlink" target="_blank" href="<?php echo $topic['url'];?>"><?php echo cutStr($topic['title'],40,'...');?></a>
<a class="group_title glink" target="_blank" href="<?php echo FU('group/detail',array("fid"=>$topic['fid'])); ?>"><?php echo cutStr($topic['group']['name'],40,'...');?></a>
</div>
</li>
<?php } } ?>
</ul>
</div>
<div id="pic_tpk_btn" class="pic_tpk_btn">
<div></div>
</div>
</div>
<script type="text/javascript">
jQuery(function($){
$("#pic_tpk ul").carouFredSel({
curcular: false,
infinite: false,
auto : true,
pauseDuration:3000,
pagination: "#pic_tpk_btn div",
scroll: {
pauseOnHover: true
}
});
});
</script>
<div class="top-reco fr" style="width:580px;margin:0 10px">
<div class="arr">
<a class="c_arr aleft alstop"  href="javascript:;"></a>
<a class="c_arr aright" href="javascript:;"></a>
</div >
<div id="new_topic_box">
<ul class="reco_group"><?php if(is_array($best_pics)) { foreach($best_pics as $topic) { ?><li>
<a class="fr" href="<?php echo $topic['url'];?>" target="_blank"><img class="r5" src="<?php echo getImgName($topic['imgs'][0]['img'],100,100,1); ?>" height="80" width="80"></a>
<h3 class="rg_tt" ><a class="tlink" href="<?php echo $topic['url'];?>" target="_blank"><?php echo cutStr($topic['title'],42,'...');?></a></h3>
<p class="rg_con" ><?php echo cutStr($topic['content'],26,'...');?></p>
<p class="rg_gt"><a class="glink" href="<?php echo FU('group/detail',array("fid"=>$topic['fid'])); ?>" target="_blank"><?php echo cutStr($topic['group']['name'],20,'...');?></a></p>										
</li>
<?php } } ?>
</ul>
<ul class="reco_topic"><?php if(is_array($best_text)) { foreach($best_text as $topic) { ?><li><?php echo setTplUserFormat($topic['uid'],1,0,'s',32,'','u_name fl r3',''); ?><p class="rt_tt" ><a class="tlink" href="<?php echo $topic['url'];?>" target="_blank"><?php echo cutStr($topic['title'],30,'...');?></a></p>
<p class="rt_gt" ><a class="glink" href="<?php echo FU('group/detail',array("fid"=>$topic['fid'])); ?>" target="_blank"><?php echo cutStr($topic['group']['name'],30,'...');?></a></p>
</li>
<?php } } ?>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
var topTopicIndex = 1;
var maxTopTopicIndex = 6;
jQuery(function($){
$('.aleft').click(function(){
if(!$(this).hasClass('alstop'))
{
if(topTopicIndex <= 1)
return;

topTopicIndex--;
getNewTopics();
}
});

$('.aright').click(function(){
if(!$(this).hasClass('arstop'))
{
if(topTopicIndex >= maxTopTopicIndex)
return;

topTopicIndex++;
getNewTopics();
}
});
});

function getNewTopics()
{
$.ajax({ 
url: SITE_PATH+"services/service.php?m=topic&a=news",
type: "POST",
data:{"page":topTopicIndex},
dataType: "json",
success: function(result){
if(result.status == 1 || result.status == 2)
{
$("#new_topic_box").html(result.html);
}

if(result.status > 1)
{
maxTopTopicIndex = topTopicIndex;
}

$(".c_arr").removeClass('alstop').removeClass('arstop');
if(topTopicIndex >= maxTopTopicIndex)
{
topTopicIndex = maxTopTopicIndex;
$(".aright").addClass('arstop');
}
else if(topTopicIndex <= 1)
{
topTopicIndex = 1;
$(".aleft").addClass('alstop');
}
}
});
}
</script>